package lawyer.controller;
import common.model.Appeal;
import common.model.Lawyer;
import lawyer.Service.LawyerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/lawyer/profile")
public class LawyerProfileController {

    @Autowired
    private LawyerService lawyerService;

    @PutMapping("/update")
    public ResponseEntity<Lawyer> updateProfile(@RequestBody Lawyer lawyer) {
        return ResponseEntity.ok(lawyerService.updateProfile(lawyer));
    }

    @GetMapping("/get/{id}")
    public ResponseEntity<Lawyer> getProfile(@PathVariable Long id) {
        return ResponseEntity.ok(lawyerService.getProfile(id));
    }

    @PutMapping("/setPreferences")
    public ResponseEntity<Void> setPreferences(@RequestBody List<String> preferences, @RequestParam Long lawyerId) {
        lawyerService.setPreferences(preferences, lawyerId);
        return ResponseEntity.noContent().build();
    }

    @PostMapping("/appeal")
    public ResponseEntity<Void> appealFreeze(@RequestBody Appeal appeal) {
        lawyerService.appealFreeze(appeal);
        return ResponseEntity.noContent().build();
    }

    @GetMapping("/contactSupport")
    public ResponseEntity<Void> contactSupport() {
        // 实现联系客服逻辑
        return ResponseEntity.noContent().build();
    }
}
